Skip to content

feat: use Test-Json whenever possible#39

Merged
lupino3 merged 3 commits intomainfrom
dev/andreas/use-test-json
Jul 7, 2022
Merged

feat: use Test-Json whenever possible#39
lupino3 merged 3 commits intomainfrom
dev/andreas/use-test-json

Conversation

@lupino3
Copy link
Copy Markdown
Member

@lupino3 lupino3 commented Jul 7, 2022

This will remove the dependency from external assemblies in
PowerShell >= 6.1.0, and therefore increase compatibility by
removing the possibility of assembly conflicts or assembly loading
errors.

lupino3 added 3 commits July 7, 2022 16:08
This will remove the dependency from external assemblies in
PowerShell >- 6.1.0, and therefore increase compatibility by
removing the possibility of assembly conflicts or assembly loading
errors.
The error message differs between Test-Json and NJsonSchema,
and its validation adds no value to the tests, as that invalid JSON
is already tested in another test case.
The code would not work for 6.1.0, as it would try to import
NJsonSchema and Newtonsoft.JSON.
@lupino3
Copy link
Copy Markdown
Member Author

lupino3 commented Jul 7, 2022

The tests under CI (Windows Powershell 5.1.20348.643 and Powershell 7.2.5) pass.
I also used the Docker test files and got the following, expected results:

  • 6.0.4 fails
  • 6.1.0 works
  • 6.1.3 works
  • 7.0.0 works
  • 7.1.5 works

The change looks good and I'm merging it. I'll see if there is an easy fix for 6.x (with x < 1).

@lupino3 lupino3 merged commit b67eaff into main Jul 7, 2022
@lupino3 lupino3 deleted the dev/andreas/use-test-json branch July 7, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant